/*
* Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Description:
* Author: huawei
* Create: 2022-8-15
*/
#ifndef TRS_STARS_CQ_H
#define TRS_STARS_CQ_H

#include <linux/types.h>

#include "trs_pub_def.h"
#include "trs_core.h"

#define TRS_STARS_CQE_HOLDER    3
#define TRS_STARS_CQE_RECORED   4

int trs_stars_cq_head_update(struct trs_id_inst *inst, u32 cqid, u32 head);
int trs_stars_cq_get_valid_list(struct trs_id_inst *inst, u32 group, u32 cqid[], u32 num, u32 *valid_num);
int trs_stars_cqe_get_streamid(struct trs_id_inst *inst, void *cqe, u32 *stream_id);
bool trs_stars_cqe_is_valid(struct trs_id_inst *inst, void *cqe, u32 round);
void trs_stars_cqe_get_sqid(struct trs_id_inst *inst, void *cqe, u32 *sqid);
void trs_stars_cqe_get_sq_head(struct trs_id_inst *inst, void *cqe, u32 *sq_head);
void trs_stars_cqe_to_logic_cqe(void *hw_cqe, struct trs_logic_cqe *logic_cqe);

#endif /* TRS_STARS_CQ_H */
